<!--
  ~ Copyright 2010 Pierre Heinzerling, Uwe Janner, Patrick Wright
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~        http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<html>
<head>
    <link type="text/css" rel="stylesheet" href="css/table_border.css"/>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
    <script type="text/javascript">
        function addMessage(msg) {
            var now = new Date();
            var when = now.getMinutes() + ":" + now.getSeconds() + ":" + now.getMilliseconds();
            $('#logtable tr:first').before('<tr><td>' + when + "&nbsp;&nbsp;&nbsp;" + msg + '</td></tr>');
        }
        function removeAllRowsFromTable(tableId) {
            $('#logtable').children().remove();
            $('#logtable').append("<tr></tr>");
            addMessage("Start");
        }
        chrome.extension.onRequest.addListener(
                function(request, sender, sendResponse) {
                    if (request.msg) {
                        addMessage(request.msg);
                    }
                    sendResponse({}); // snub them.
                });

    </script>
</head>
<body onload="addMessage('Start')">
<p style="text-align:center">Global Log&nbsp;<a href="#" onclick="removeAllRowsFromTable('logtable')"><img src="icons/script_delete.png" class="png" title="clear log"/></a></p>
<table width="100%" id="logtable">
    <tbody>
    <tr>&nbsp;</tr>
    </tbody>
</table>
</body>
</html>